<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="m@markzou.com">
    <link rel="shortcut icon" href="favicon.png">
     <title>${(jshopbasicinfo.jshopname)}</title>
    <#if (jshopbasicinfo.metaKeywords)! != "">
        <meta name="keywords" content="${jshopbasicinfo.metaKeywords}"/>
        </#if>
        <#if (jshopbasicinfo.metaDes)! != "">
        <meta name="description" content="${jshopbasicinfo.metaDes}"/>
        </#if>
    <!-- fav icons -->
    <link rel="shortcut icon" href="${basepath}/ui/assets/img/favicon.png" />

    <link rel="stylesheet" type="text/css" href="${basepath}/ui/assets/css/inc_default_theme.css">
    <link rel="stylesheet" type="text/css" href="${basepath}/ui/assets/css/bootstrap.css">

    <script src="${basepath}/ui/assets/js/bootstrap.min.js"></script>
    <script src="${basepath}/ui/assets/js/jquery-1.9.0.min.js"></script>

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="${basepath}/ui/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respipond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="${basepath}/ui/assets/js/html5shiv.js"></script>
      <script src="${basepath}/ui/assets/js/respond.min.js"></script>
    <![endif]-->

</head>
 <body>
<div class="container-fluid nopadding">

    <div class="page_content_loginpage">

        <div class="pc_head">

            <div class="pc_nonav">
                <div class="pc_w1200">
                    <div class="huacha_login_logo"><a href="${basepath}/index.action">${(jshopbasicinfo.jshopname)}</a></div>
                    <div class="top_catalog"><img src="${basepath}/ui/assets/img/icons/catalog.png" alt=""/></div>
                </div>
            </div>
        </div>
       <div class="pc_body user_login_body">
            <div class="pc_w1200">

                <div class="pc_mod">

                    <div class="user_regiest">
                        <div class="row">
                            <div class="col-md-8" style="border-right: 1px #ccc dotted;">
                                <div class="col_left">
                                    <div class="login_tit">
                                        注册新用户
                                        <span>现在注册，立享优惠。。</span>
                                    </div>
                                <form id="form" action="${basepath}/register.action" method="post">
                                    <div class="login_form form-horizontal">
		          <div id="msg">
		                 <#if (loginnamestatus) ??>
                                                <div id="msgname" class="alert alert-danger alert-dismissible fade in" role="alert" style="padding: 5px 15px !important;"><strong>错误!</strong> 邮箱已经注册！</div>
                                            </#if>							
		          </div>
                                     
                                       <!--<div class="alert alert-success alert-dismissible fade in" role="alert" style="padding: 5px 15px !important;">
                                            <strong>成功!</strong> 登录中，请稍后！
                                        </div>-->
                                        <div class="form-group">
                                            <label for="inputEmail3" class="col-sm-2 control-label" style="padding-right: 0px;">用户名</label>
                                            <div class="col-sm-10">
                                                <input type="email" id="loginname" name="loginname"  class="form-control input-lg" id="inputEmail3" placeholder="输入正确的邮箱地址">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputPassword3" class="col-sm-2 control-label" style="padding-right: 0px;">密码</label>
                                            <div class="col-sm-10">
                                                <input type="password" id="loginpwd" name="loginpwd"  class="form-control input-lg" id="inputPassword3" placeholder="您的密码">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputPassword3" class="col-sm-2 control-label" style="padding-right: 0px;">确认密码</label>
                                            <div class="col-sm-10">
                                                <input type="password" id="replypassword"  name="replypassword" class="form-control input-lg" id="inputPassword5" placeholder="您的密码">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-offset-2 col-sm-10">
                                                <button type="submit" id="submit" class="btn btn-primary btn-lg">注册</button>
                                            </div>
                                        </div>
                                    </div>
		      </form>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="col_right">
                                    <div class="login_tit">
                                        已有账号！
                                        <span>现在登录，填满您的购物车。</span>
                                    </div>
                                    <div class="login_form">
                                        <div class="form-group">
                                            <button type="submit" id="nowlogin" class="btn btn-success btn-lg">现在登录</button>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>

                    </div>

                </div>

            </div>

        </div>
 <#include "/WEB-INF/theme/default/shop/footer.ftl">
 </body>
 <script type="text/javascript">
 	$(document).ready(function(){
                    $("#form").submit(function(){
                            $("#msg").empty();
                            //登陆名 
                            var loginname = $("#loginname").val().trim();
                            //密码
                            var password = $("#loginpwd").val().trim();
                            //重复密码
                            var passwordReply = $("#replypassword").val().trim();
                            //邮箱验证
                            var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
                            if(!myreg.test(loginname))
                            {
                                $("#msg").append("<div id='msgname' class='alert alert-danger alert-dismissible fade in' role='alert' style='padding: 5px 15px !important;'><strong>错误!</strong> 邮箱不符合规范！</div>");
                                return false;  
                            } 
                            if(loginname==""){
                                $("#msg").append("<div id='msgname' class='alert alert-danger alert-dismissible fade in' role='alert' style='padding: 5px 15px !important;'><strong>错误!</strong> 登陆邮箱不能为空！</div>");                              
                                return false;                   
                            }
                            if (loginname.length < 4 || loginname.length > 40) {
                                 $("#msg").append("<div id='msgname' class='alert alert-danger alert-dismissible fade in' role='alert' style='padding: 5px 15px !important;'><strong>错误!</strong> 登陆邮箱长度不得小于4位或者超过40位！</div>");                              
                                  return false;  
                            };
                            if(password == ""){
                                
                                   $("#msg").append("<div id='msgname' class='alert alert-danger alert-dismissible fade in' role='alert' style='padding: 5px 15px !important;'><strong>错误!</strong> 请输入密码！</div>");  
                                return false;       
                            }  
                            if(password.length < 6 || password.length >20){
                                $("#msg").append("<div id='msgname' class='alert alert-danger alert-dismissible fade in' role='alert' style='padding: 5px 15px !important;'><strong>错误!</strong> 密码长度不能小于6位或者大于20位！</div>");  
                            return false;   
                            }                      
                        if(passwordReply == ""){
                                $("#msg").append("<div id='msgname' class='alert alert-danger alert-dismissible fade in' role='alert' style='padding: 5px 15px !important;'><strong>错误!</strong> 请输入确认密码！</div>");  
                            return false;   
                        }
                        if(password != passwordReply){
                            $("#msg").append("<div id='msgname' class='alert alert-danger alert-dismissible fade in' role='alert' style='padding: 5px 15px !important;'><strong>错误!</strong> 两次密码不一致！</div>");  
                            return false;
                        }
 	});
            $("#nowlogin").click(function(){
                window.location = "${basepath}/gologin.action";
            });
})
 </script>
</html>